<%
// This macro is made to deal with Glossary disambiguation
// It must be include inside any disambiguation page and will automatically list the various terms definitions

// ENVIRONEMENT
// ----------------------------------------------------------------------------
var ARTICLES  = [];

// EXTRACT CONTENT
// ----------------------------------------------------------------------------

(await page.subpagesExpand(env.url, 1)).forEach(function (p) {
    ARTICLES.push({
        title  : p.title,
        summary: p.summary,
        url    : p.url,
    });
});

ARTICLES.sort(function (a,b) {
    return a.title.localeCompare(b.title);
})

// DISPLAY
// ----------------------------------------------------------------------------
%>
<dl>
<%
for (n in ARTICLES) {
%>
    <dt><a href="<%= ARTICLES[n].url %>"><%- ARTICLES[n].title %></a></dt>
    <dd><%- ARTICLES[n].summary %></dd>
<%
}
%>
</dl>
